<div class="event-details carat-bottom">
  <a href="#" class="popover_close x-close-link close" role="button" aria-label="{{#t "close"}}Close{{/t}}">×</a>
  <div class='event-details-header'>
    <h3 class="details_title title">
      {{#if showEventLink}}
        <a href="{{fullDetailsURL}}" class="view_event_link">{{title}}</a>
      {{else}}
        {{title}}
      {{/if}}
    </h3>
  </div>
  <div class="event-details-content">
    <div class="event-details-timestring">{{{displayTimeString}}}</div>
    <table cellspacing="0" role="presentation">
      {{#if contextInfo}}
        <tr>
          <th scope="row">{{#t "calendar"}}Calendar{{/t}}</th>
          <td><a href="{{contextInfo.url}}">{{contextInfo.name}}</a>
            {{#if actualContextInfo}}
              <br><span class="event-details-actual-context">{{actualContextInfo.name}}</span>
            {{/if}}
          </td>
          {{#if isGreaterThanOne}}
            <td title="{{list contextsName}}">
              {{#t}} + {{n contextsCount}} more{{/t}}
              
            </td>
          {{/if}}
        </tr>
      {{/if}}
      {{#if location_name}}
        <tr>
          <th scope="row">{{#t "location"}}Location{{/t}}</th>
          <td>{{location_name}}</td>
        </tr>
      {{/if}}
      {{#if location_address}}
              <tr>
                <th scope="row">{{#t "location_address"}}Address{{/t}}</th>
                <td>{{location_address}}</td>
              </tr>
            {{/if}}
      {{#if description}}
        <tr>
          <th scope="row">{{#t "details"}}Details{{/t}}</th>
          <td class="user_content">
            <div class="event-detail-overflow">{{convertApiUserContent description}}</div>
          </td>
        </tr>
      {{/if}}
      {{#unless isPlannerNote}}
        <tr id='reservations'>
          <th scope="row">{{#t "attendees"}}Attendees{{/t}}</th>
          {{#if reservations}}
              <td>
                {{#if can_edit}}
                  <ul id="attendees">
                    {{#each reservations}}
                    <li data-url="{{event_url}}">
                      <div class="ellipsis">{{name}}</div>
                      <button type="button" class="cancel_appointment_link" title="{{#t}}Remove attendee {{name}}{{/t}}">
                        <i class="icon-x" aria-hidden="true"></i>
                        
                      </button>
                    </li>
                    {{/each}}
                  </ul>
                {{else}}
                  <ul>
                    {{#each reservations}}
                      <li>{{name}}</li>
                    {{/each}}
                  </ul>
                {{/if}}
              </td>
          {{/if}}
        </tr>
      {{/unless}}
      {{#if availableSlotsText}}
        <tr>
          <th scope="row">{{#t "slots_available"}}Slots available{{/t}}</th>
          <td>{{availableSlotsText}}</td>
        </tr>
      {{/if}}
      {{#if reserve_comments}}
        <tr>
          <th scope="row">{{#t}}Comments{{/t}}</th>
          <td>{{reserve_comments}}</td>
        </tr>
      {{else}}
        {{#if reservations}}
          <tr>
            <th scope="row">{{#t}}Comments{{/t}}</th>
            <td>
              <ul>
                {{#each reservations}}
                  {{#if comments}}
                    <li><em>{{name}}</em>: {{comments}}</li>
                  {{/if}}
                {{/each}}
              </ul>
            </td>
          </tr>
        {{/if}}
      {{/if}}
    </table>
    <div class="details_description lock_explanation">{{{lock_explanation}}}</div>
    {{#if available_slots_text}}
      <div class="available_slots">
        {{available_slots_text}}
      </div>
    {{/if}}
  </div>
  {{#ifAny can_edit can_delete can_reserve can_unreserve}}
    <div class="popover-links-holder event-details-footer">
      <div class="pull-right">
        {{#ifAll can_edit is_appointment_group use_new_scheduler}}
          <a href={{editGroupURL}} class="group_details Button Button--small">{{#t}}Group Details{{/t}}</a>
        {{/ifAll}}
        {{#if can_delete }}
          <button class="event_button Button Button--small delete_event_link">{{#t "links.delete"}}Delete{{/t}}</button>
        {{/if}}
        {{#if can_edit }}
          <button class="event_button edit_event_link Button Button--small Button--primary">{{#t "links.edit"}}Edit{{/t}}</button>
        {{/if}}
      </div>
      <div class="event-details-links">
        {{#if can_reserve }}
          <p>
            <label for="appointment-comment"><b>{{#t}}Comments{{/t}}</b></label><br />
            <textarea id="appointment-comment" maxlength="255" name="appointment-comment"/>
          </p>
          <button class="reserve_event_link Button Button--small Button--link"><strong>{{#t "links.reserve"}}Reserve{{/t}}</strong></button>
        {{/if}}
        {{#if can_unreserve }}
          <button class="unreserve_event_link Button Button--small Button--link">{{#t "links.unreserve"}}Un-reserve{{/t}}</button>
        {{/if}}
        {{#if can_edit}}
          {{#if reservations }}
            <button class="message_students Button Button--small Button--link">
              {{#t "message_students"}}Message students{{/t}}
            </button>
          {{/if}}
        {{/if}}
      </div>
    </div>
  {{/ifAny}}
</div>
